<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>更新图书</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f5f6fa;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            flex-direction: column;
            box-sizing: border-box;
        }

        /* 标题样式 */
        h2 {
            font-size: 24px;
            color: #2c3e50;
            margin-bottom: 20px;
            text-align: center;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
        }

        /* 表单容器样式 */
        .form-container {
            width: 90%;
            max-width: 500px;
            background-color: #ffffff;
            border-radius: 15px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            padding: 20px 25px; /* 调整右侧间距 */
        }

        /* 输入框样式 */
        input[type="text"] {
            width: 96%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 14px;
            transition: border-color 0.3s ease;
        }

        input[type="text"]:focus {
            border-color: #4CAF50;
            outline: none;
        }

        /* 提交按钮样式 */
        input[type="submit"] {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s ease;
            width: 100%;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <h2>更新图书</h2>
    <div class="form-container">
        <form action="/bookstore/update_book/{{ book_id }}" method="post">
            <label for="title">书名：</label>
            <input type="text" id="title" name="title" placeholder="请输入书名" value="{{ book.title }}" readonly required>

            <label for="pub">出版社：</label>
            <input type="text" id="pub" name="pub" placeholder="请输入出版社" value="{{ book.pub }}" readonly required>

            <label for="price">价格：</label>
            <input type="text" id="price" name="price" placeholder="请输入价格" value="{{ book.price }}" required>

            <label for="market_price">零售价：</label>
            <input type="text" id="market_price" name="market_price" placeholder="请输入零售价" value="{{ book.market_price }}" required>

            <input type="submit" value="提交">
        </form>
    </div>
</body>
</html>